package com.briup.recognition.web.controller;


import com.briup.recognition.bean.BaseConfig;
import com.briup.recognition.service.IBaseConfigService;
import com.briup.recognition.service.impl.BaseConfigServiceImpl;
import com.briup.recognition.utils.Message;
import com.briup.recognition.utils.MessageUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("baseConfig")
public class BaseConfigController {
    @Resource
    private IBaseConfigService baseConfigService;

    @GetMapping
    public Message query(){
        List<BaseConfig> list= baseConfigService.query();
        return MessageUtil.success(list);
    }

    @PostMapping
    public Message saveOrUpdate(BaseConfig baseConfig){
        baseConfigService.saveOrUpdate(baseConfig);
        return MessageUtil.success("操作成功");

    }

    @DeleteMapping
    public Message deleteById(long id){
        baseConfigService.deleteById(id);
        return MessageUtil.success("删除成功");

    }


}
